package DomainP

class Trip {
    String name
    String city
    Date startDate
    Date endDate
    
    String purpose
    String notes
    static belongsto = [owner : User] 
    static hasOne = [budget : Budget]
    
    static constraints = {
        name blank: false, size: 3..15, unique:true
        city blank: false
        startDate blank: false, min: new Date()
        endDate blank: false, min: new Date()
        purpose blank: false, inList: ["Pleasure", "Education","business","Scientific","Political"]
        notes blank: false
    }
}
